/**
 * 为Count组件升成action对象
 */
import { INCREMENT, DECREMENT } from '../contant/count';

import { anyAction } from '../reducer/interface';
export const increment = (payload: anyAction) => {
    return { type: INCREMENT, payload };
};
export const decrement = (payload: anyAction) => {
    return { type: DECREMENT, payload };
};
export const incrementAsync = (payload: anyAction, time: number) => {
    // eslint-disable-next-line
    return (dispatch: Function) => {
        setTimeout(() => {
            dispatch(increment(payload));
        }, time);
    };
};
